#include "mviewer.h"

#include "mutil.h"

MViewer::MViewer(QObject *parent) :
    QGraphicsScene(parent)
{
    setSceneRect(-250, -50, 500, 150);
    prev = new MSeat;
    you = new MSeat;
    next = new MSeat;

    this->addItem(prev);
    this->addItem(you);
    this->addItem(next);

    prev->moveBy(-90, 0);
    you->moveBy(0, 50);
    next->moveBy(90, 0);
    // TODO
}


MSeat *MViewer::getSeat(MGame::PlayerID id)
{
    if (id == MGame::PREV)
        return prev;
    if (id == MGame::YOU)
        return you;
    if (id == MGame::NEXT)
        return next;
    MUtil::debugAndExit("err_seat");
    return NULL;
}
